

from selenium import webdriver
from selenium.webdriver.common.by import By
from common.base_page import BasePage

class LoginPage(BasePage):

    def __init__(self,driver):
        # self.driver=webdriver.Chrome()
        # self.driver=driver
        super().__init__(driver)
    #页面属性
    username_locator=(By.ID,'username')
    password_locator=(By.ID,'password')
    verify_code_locator=(By.ID,'verify_code')
    loginbtn_locator=(By.NAME,'sbtbutton')

    def login(self,username,password,code):
        # self.driver.find_element(*self.username_locator).send_keys(username)
        # self.driver.find_element(*self.password_locator).send_keys(password)
        # self.driver.find_element(*self.verify_code_locator).send_keys(code)
        # self.driver.find_element(*self.loginbtn_locator).click()
        self.input(self.username_locator,username,'登录模块_登录功能_用户名输入操作')
        self.input(self.password_locator,password,'登录模块_登录功能_密码输入操作')
        self.input(self.verify_code_locator,code,'登录模块_登录功能_验证码输入操作')
        self.click(self.loginbtn_locator,'登录模块_登录功能_登录按钮点击操作')



























